package com.xayy.health.mgt.mapper;

import cn.kawins.mybatis.BaseMapper;
import com.xayy.health.core.config.datasource.DatasourceSelector;
import com.xayy.health.mgt.model.TestLindorm;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;

/**
 * @author dongxingli
 * createTime 2023/9/26
 * @version V1.0
 */
public interface TestLindormMapper extends BaseMapper<TestLindorm> {
    /**
     * 导入sql脚本
     *
     * @param sql sql语句
     * @return int
     */
    @Insert("${sql}")
    int executeSql(@Param("sql") String sql);

    /**
     * 清除mysql数据
     * @param sql sql语句
     */
    @Delete("${sql}")
    void truncateMysql(@Param("sql") String sql);

    /**
     * 清除Hologres数据
     * @param sql sql语句
     */
    @Delete("${sql}")
    @DatasourceSelector(sourceName = "clickhouse")
    void cleanHologres(@Param("sql") String sql);

}
